<!-- 任务详情弹窗 -->
<style scoped>
</style>

<template>
  <div class="task-info-dialog">
    <Modal
      v-model="taskInfoDialog.visible"
      title="任务详情"
      @on-ok="ok"
      @on-cancel="cancel">
      <p>Content of dialog</p>
      <p>Content of dialog</p>
      <p>Content of dialog</p>
    </Modal>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
import {
  getTaskDetail
} from '../api/home'
export default {
  data () {
    return {}
  },
  computed: {
    ...mapState({
      taskInfoDialog: state => state.app.taskInfoDialog
    })
  },
  watch: {
    async taskInfoDialog (value) {
      if (value.visible) {
        const res = await getTaskDetail({
          id: value.row.id
        })
        if (res.code === 200) {

        } else {
          this.$Notice.error({
            title: '提示',
            desc: '获取任务信息失败'
          })
        }
      }
    }
  },
  methods: {
    ok () {

    },
    cancel () {
      this.setTaskInfoDialog({
        visible: false
      })
    },
    ...mapMutations([
      'setTaskInfoDialog'
    ])
  }
}
</script>

